<!--title-->
<div class="mnav1">
	<div class="m_nav">
		<div class="nav_left">
			<em class="home_icon"><?=$this->sys_name?></em><span>&nbsp;&gt;&nbsp;</span><font><?=$this->title?></font>
		</div>
	</div>
</div>

<div class="content-table">
<div class="content-table-title"><?=$this->title?></div>
<br />
<?php if($this->msg):?>
<div class="replace"><?=$this->msg?></div>
<br />
<?php endif;?>
<div class="form-edit-task">
<form action="/contracts/add-pay-plan2-submit" method="post" name="form1" onsubmit="submitform(this);return false;">
<table border="1" width="100%">
	<tr>
		<td align="right">计划回款日期：</td>
		<td align="left">&nbsp;<input type="text" name="plan_date" id="plan_date" style="width: 100px" autocomplete="off"><font color="red"> *</font></td>
	</tr>
	<tr>
		<td align="right">金额：</td>
		<td align="left">&nbsp;<input type="text" name="plan_value" id="plan_value" style="width: 100px" onkeyup='num(this)'><font color="red"> *</font></td>
	</tr>
    <tr id="hxb">
        <td align="right">备注：</td>
        <td align="left">&nbsp;<input type="text" name="tips" id="tips" placeholder="备注" style="width: 200px"></td>
    </tr>
</table>
<br /><br />
<input type="button" class="buttonlong" value="提交" onclick="submitform();return false;" />
<br /><br />
<br /><br />
<?php if($this->contract_id):?>
<input type="hidden" name="contract_id" value="<?=$this->contract_id?>" />
<?php endif;?>
</form>
</div>
<br/><br/>
</div>

<script>
function num(th){
	th.value = th.value.replace(/[^\d\.\-]*$/g, '');
}

$(function() {
	$( "#plan_date" ).datepicker({ dateFormat: 'yy-mm-dd'});
});

function submitform() 
{
	
	if( document.form1.plan_date.value.length == 0 )
	{
		alert("计划回款日期不能为空。");
		return false;
	}else if( document.form1.plan_value.value.length == 0 )
	{
		alert("金额不能为空。");
		return false;
	}
	
	form1.submit();
}
</script>
